package Enumeration;

/**
 * @author Marty
 * @version 1.0
 * @created 23-III-2012 10:10:49
 */
public enum ChoosenDate {
        fromTo("od-do",0),
        month("měsíc",1),
	all("vše",2);
	
        
    private final String type;
    private final int index;
    private ChoosenDate(String type, int index) {
        this.type=type;
        this.index=index;
    }

    public int getIndex() {
        return index;
    }

    public String getType() {
        return type;
        
    }
    public ChoosenDate getChoosen(String i) {
        for(ChoosenDate choosen:ChoosenDate.values()) {
            if(choosen.getType().equals(i)) return choosen;
        }
        return null;
    }
    
}